/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.customsdeclarationinfo;

import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import java.util.List;

/**
 * 报关资料Entity
 *
 * @author LV
 * @version 2021-03-02
 */
@Table(name = "t_customs_declaration_info", alias = "a", columns = {
        @Column(name = "customs_declaration_info_id", attrName = "customsDeclarationInfoId", label = "报关资料ID", isPK = true, queryType = QueryType.LIKE),
        @Column(name = "version_type", attrName = "versionType", label = "版型"),
        @Column(name = "destination", attrName = "destination", label = "目的港"),
        @Column(name = "remarks", attrName = "remarks", label = "备注信息", isQuery = false),
        @Column(name = "create_by", attrName = "createBy", label = "创建者", isUpdate = false),
        @Column(name = "create_date", attrName = "createDate", label = "创建时间", isUpdate = false),
        @Column(name = "update_by", attrName = "updateBy", label = "更新者", isQuery = false),
        @Column(name = "update_date", attrName = "updateDate", label = "更新时间", isQuery = false),
},joinTable = {
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "createByUser", alias = "createby",
                on = "createby.user_code = a.create_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "updateByUser", alias = "updateby",
                on = "updateby.user_code = a.update_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
}	, orderBy = "a.update_date DESC"
)
public class CustomsDeclarationInfo extends DataEntity<CustomsDeclarationInfo> {

    private static final long serialVersionUID = 1L;
    private String customsDeclarationInfoId;        // 报关资料ID
    private String versionType;        // 版型
    private String destination;        // 目的港
    private List<CustomsDeclarationInfoDetail> customsDeclarationInfoDetailList = ListUtils.newArrayList();        // 子表列表
    private User createByUser;
    private User updateByUser;


    public CustomsDeclarationInfo() {
        this(null);
    }

    public CustomsDeclarationInfo(String id) {
        super(id);
    }

    public String getCustomsDeclarationInfoId() {
        return customsDeclarationInfoId;
    }

    public void setCustomsDeclarationInfoId(String customsDeclarationInfoId) {
        this.customsDeclarationInfoId = customsDeclarationInfoId;
    }

    @Length(min = 0, max = 2, message = "版型长度不能超过 2 个字符")
    public String getVersionType() {
        return versionType;
    }

    public void setVersionType(String versionType) {
        this.versionType = versionType;
    }

    @Length(min = 0, max = 2, message = "目的港长度不能超过 2 个字符")
    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public List<CustomsDeclarationInfoDetail> getCustomsDeclarationInfoDetailList() {
        return customsDeclarationInfoDetailList;
    }

    public void setCustomsDeclarationInfoDetailList(List<CustomsDeclarationInfoDetail> customsDeclarationInfoDetailList) {
        this.customsDeclarationInfoDetailList = customsDeclarationInfoDetailList;
    }

    public User getCreateByUser() {
        return createByUser;
    }

    public void setCreateByUser(User createByUser) {
        this.createByUser = createByUser;
    }

    public User getUpdateByUser() {
        return updateByUser;
    }

    public void setUpdateByUser(User updateByUser) {
        this.updateByUser = updateByUser;
    }
}